<?php
/**
 * Introduction: 优惠卷
 * @author: 杨陈鹏
 * @email: wanglong@cdlinglu.com
 */

namespace WeChat\Controller\Member;


use Common\Controller\WeChat\SignController;

class VolumeController extends SignController
{

    /**
     * Introduction: 优惠卷列表
     * @author: 杨陈鹏
     * @email: wanglong@cdlinglu.com
     */

    public function lists()
    {

        $page = I('post.page',1);
        $nums = I('post.nums',20);

        $data = I('post.data');

        $type = $data['type'];

        $where = 'uid = '.self::$uid;
        //未使用
        if($type == 1)
            $where .= " AND status = 1 AND end_time >= ".NOW_TIME;

        if($type == 2)
            $where .= " AND status = 2";

        if($type == 3)
            $where .= " AND status = 1 AND end_time < ".NOW_TIME;

        $logic = D('Common/Volume','Logic');

        outPut($logic::getData($where,$page,$nums,'*'));


    }

}